package com.prs.crm.domain.oa;

import java.util.Date;
import java.util.List;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.BaseEntity;

@Entity
@Table(name="oa_notice")
public class Notice extends BaseEntity{
	
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	private String title;
	@ManyToOne(fetch=FetchType.LAZY)
	@Cascade(CascadeType.REFRESH)
	private Attachment attach;
	@Lob
	private String content;
//	@OneToMany(fetch=FetchType.LAZY,mappedBy="notice")
//	private Set<NoticeAccept> accepts;
	@OneToMany(fetch=FetchType.LAZY,mappedBy="notice")
	private Set<NoticeCollect> collects;
	private String type; //重要程度
	private Integer oabox; //0表示草稿，1表示已发新闻，2表示已归档,3表示已收藏
	private Integer stateID;
	//OA字段
	private String receive; //接收人
	private String accept;  //接收人id
	private String degree;  //重要程度
	private String isReceipt;  //收到后给我一个回执
	private String isComment;  //允许评论
	private String level;  //样式
	private Date creatTime;  //创建时间
	private Integer top;//0不置顶，1置顶
	@OneToMany(fetch=FetchType.LAZY,mappedBy="notice")
	private List<Comment> comment;
	public List<Comment> getComment() {
		return comment;
	}
	public void setComment(List<Comment> comment) {
		this.comment = comment;
	}
	public Integer getTop() {
		return top;
	}
	public void setTop(Integer top) {
		this.top = top;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public Integer getOabox() {
		return oabox;
	}
	public void setOabox(Integer oabox) {
		this.oabox = oabox;
	}
	public void setAttach(Attachment attach) {
		this.attach = attach;
	}
	public Attachment getAttach() {
		return attach;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public Integer getStateID() {
		return stateID;
	}
	public void setStateID(Integer stateID) {
		this.stateID = stateID;
	}
	public String getReceive() {
		return receive;
	}
	public void setReceive(String receive) {
		this.receive = receive;
	}
	
//	public Set<NoticeAccept> getAccepts() {
//		return accepts;
//	}
//	public void setAccepts(Set<NoticeAccept> accepts) {
//		this.accepts = accepts;
//	}
	public String getAccept() {
		return accept;
	}
	public void setAccept(String accept) {
		this.accept = accept;
	}

	public String getDegree() {
		return degree;
	}
	public void setDegree(String degree) {
		this.degree = degree;
	}
	public String getIsReceipt() {
		return isReceipt;
	}
	public void setIsReceipt(String isReceipt) {
		this.isReceipt = isReceipt;
	}
	public String getIsComment() {
		return isComment;
	}
	public void setIsComment(String isComment) {
		this.isComment = isComment;
	}
	public String getLevel() {
		return level;
	}
	public void setLevel(String level) {
		this.level = level;
	}
	public Date getCreatTime() {
		return creatTime;
	}
	public void setCreatTime(Date creatTime) {
		this.creatTime = creatTime;
	}
	public Set<NoticeCollect> getCollects() {
		return collects;
	}
	public void setCollects(Set<NoticeCollect> collects) {
		this.collects = collects;
	}
	
}
